<span page-title ng-model="environment">{{ 'Lifecycle Environment:' | translate }} {{ environment.name }}</span>

<div data-block="left-column">
  <h4 translate>Basic Information</h4>

  <dl class="dl-horizontal dl-horizontal-left">
    <dt translate>Name</dt>
    <dd bst-edit-text="environment.name"
        on-save="save(environment)"
        readonly="denied('edit_lifecycle_environments', environment) || environment.library">
    </dd>

    <dt translate>Label</dt>
    <dd>{{ environment.label }}</dd>

    <dt translate>Description</dt>
    <dd bst-edit-textarea="environment.description"
        on-save="save(environment)"
        readonly="denied('edit_lifecycle_environments', environment) || environment.library">
    </dd>
  </dl>

  <h4 translate>Container Image Registry</h4>

  <dl class="dl-horizontal dl-horizontal-left">
    <dt translate>Unauthenticated Pull</dt>
    <dd>
      <div bst-edit-checkbox="environment.registry_unauthenticated_pull"
           formatter="booleanToYesNo"
           on-save="save(environment)"
           readonly="denied('edit_lifecycle_environments', environment)">
      </div>
      <div bst-alert='info'>
        <span translate>
          Determines whether to require login to pull container images in this lifecycle environment.
        </span>
      </div>
    </dd>
    <dt translate>Registry Name Pattern</dt>
    <dd>
      <div bst-edit-textarea="environment.registry_name_pattern"
           on-save="save(environment)"
           readonly="denied('edit_lifecycle_environments', environment)">
      </div>
      <div bst-alert='info'>
        <span translate>
          The <i>Registry Name Pattern</i> overrides the default name by which container images may be pulled from the server. (By default this name is a combination of Organization, Lifecycle Environment, Content View, Product, and Repository labels.)

          <br/><br/>The name may be constructed using ERB syntax. Variables available for use are:

          <pre>
organization.name
organization.label
repository.name
repository.label
repository.docker_upstream_name
content_view.label
content_view.name
content_view_version.version
product.name
product.label
lifecycle_environment.name
lifecycle_environment.label</pre>

          Examples:
            <pre>
&lt;%= organization.label %&gt;-&lt;%= lifecycle_environment.label %&gt;-&lt;%= content_view.label %&gt;-&lt;%= product.label %&gt;-&lt;%= repository.label %&gt;
&lt;%= organization.label %&gt;/&lt;%= repository.docker_upstream_name %&gt;</pre>
        </span>
      </div>
    </dd>
  </dl>
</div>
